package 面试;

public class HelloGC {
    public static void main(String[] args) throws InterruptedException {
        System.out.println("********HelloGC");
        Thread.sleep(Integer.MAX_VALUE);
        long totalMemory = Runtime.getRuntime().totalMemory(); //返回java虚拟机中内存总量
        long maxMemory = Runtime.getRuntime().maxMemory();     //返回java虚拟机试图获取的最大内存
        System.out.println("totalMemory(-Xms)=" + totalMemory + "字节\t" + totalMemory/(double)1024/1024 + "MB");
        System.out.println("maxMemory(-Xmx)=" + maxMemory + "字节\t" + maxMemory/(double)1024/1024 + "MB");
    }
}
